package com.dailyblue.project.estate.owner.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dailyblue.project.estate.commons.bean.Owner;
import com.dailyblue.project.estate.commons.mapper.OwnerMapper;
import com.dailyblue.project.estate.commons.util.JsonResult;
import com.dailyblue.project.estate.commons.util.ResultTool;
import com.dailyblue.project.estate.owner.service.OwnerService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class OwnerServiceImpl extends ServiceImpl<OwnerMapper, Owner> implements OwnerService {

    @Cacheable(cacheNames = "findOwnerById", key = "#id")
    public JsonResult<Owner> findOwnerById(String id) {
        Owner owner = getById(id);
        return ResultTool.success(owner);
    }
}
